<template>
    <div style="height: 100%; width: 100%; position: relative">
        <div class="pagetop">
            <div style="width: 100%">
                <div style="float: left; width: 100%">
                    <table style="font-size: 12px" class="table2style" border="0">
                        <tr>
                            <td>生成时间</td>
                            <td>
                                <el-date-picker v-model="datetime1" type="date" align="right" value-format="yyyy-MM-dd 00:00:00" size="mini" placeholder="开始日期" :clearable="false" style="width: 180px"></el-date-picker>
                                -
                                <el-date-picker v-model="datetime2" type="date" align="right" value-format="yyyy-MM-dd 23:59:59" size="mini" placeholder="结束日期" :clearable="false" style="width: 180px"></el-date-picker>
                            </td>
                            <td align="right">条码号</td>
                            <td>
                                <el-input v-model="barcode" size="mini" style="width: 100%" @keyup.enter.native="QueryMainthen()"></el-input>
                            </td>
                            <td>
                                <el-checkbox true-label="1" false-label="0" v-model="flagcheck">已审核的报告自动发布</el-checkbox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">送检医院</td>
                            <td>
                                <rm-ddl-common v-model="hospitalcode" datatype="hospital" width="370px" @change="hospchange"></rm-ddl-common>
                            </td>
                            <td align="right">病历号</td>
                            <td>
                                <el-input v-model="patno" size="mini" style="width: 100%" @keyup.enter.native="QueryMainthen()"></el-input>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <div class="top-deal">
                                    <el-button icon="el-icon-search" @click="btnSign()">查询</el-button>
                                    <el-button icon="el-icon-close" @click="btnClear()">清除</el-button>
                                    <el-button icon="el-icon-upload2" @click="btnExport()">导出</el-button>
                                    <!-- <el-button icon="el-icon-refresh" @click="sync()">同步申请单信息</el-button> -->
                                    <el-button icon="el-icon-circle-check" @click="btnBatchSend()">应用修改到报告</el-button>
                                    <el-button icon="el-icon-circle-close" @click="btnUncheck()">解除审核</el-button>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="pagecenter">
            <rm-layout-left splitcolor="#F8F8FF" movingcolor="#e7e7ee" :splitwidth="6" :fixsize="700" :minfixsize="550">
                <template v-slot:fix>
                    <div style="height: 100%; width: 100%; background-color: #ddccbb">
                        <vxe-table show-overflow ref="xTable2" :loading="ChangeLoading" height="auto" :data="ChangeList" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe :sort-config="{ trigger: 'cell' }" header-align="center" @current-change="change_Event">
                            <vxe-table-column type="selection" width="40" :edit-render="{ name: 'selection' }" header-align="center" align="center"></vxe-table-column>
                            <vxe-table-column field="barcode" title="条码号" width="100px" align="center"></vxe-table-column>
                            <vxe-table-column field="changedt" title="修改时间" width="140px" align="center"></vxe-table-column>
                            <vxe-table-column field="statusname" title="状态" width="80px" align="center"></vxe-table-column>
                            <vxe-table-column field="changecomments" title="修改备注" width="150px" align="center"></vxe-table-column>
                            <vxe-table-column field="transdt" title="处理时间" width="140px" align="center"></vxe-table-column>
                            <vxe-table-column field="transuser" title="处理人" width="80px" align="center"></vxe-table-column>
                        </vxe-table>
                    </div>
                </template>
                <div ref="xTableDiv" style="height: 100%">
                    <vxe-table :data.sync="report_data" :loading="report_Loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="reportTable" resizable show-overflow size="mini" :row-class-name="reportRowName" show-header-overflow :optimization="{ animat: false }" :cell-class-name="reportCellName" header-align="center">
                        <vxe-table-column field="resultmsg" sortable title="操作结果" width="130" show-overflow align="center">
                            <template v-slot="{ row }">
                                <div v-if="!!row.resultmsg && row.resultmsg.indexOf('成功') > -1">{{ row.resultmsg }}</div>
                                <div v-else style="color: red">{{ row.resultmsg }}</div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="operuser" sortable title="处理人" width="60" show-overflow></vxe-table-column>
                        <vxe-table-column field="operdt" align="center" sortable title="处理时间" width="120" show-overflow></vxe-table-column>
                        <vxe-table-column field="cp_selection" title="选择" width="20px" align="center">
                            <template v-slot:header="{ column }">
                                <el-checkbox v-model="selectall" @change="ChkAll($event)"></el-checkbox>
                            </template>
                            <template v-slot="{ row, rowIndex }">
                                <el-checkbox v-model="row.cp_selection" true-label="1" false-label="0" :disabled="!!row.operuser"></el-checkbox>
                                <!-- <el-checkbox v-model="row.cp_selection" true-label="1" false-label="0" ></el-checkbox> -->
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="rechkflag" sortable title="审" width="20" show-overflow align="center">
                            <template v-slot="{ row, rowIndex, columnIndex }">
                                <div :key="row.userno + rowIndex + columnIndex" v-if="row.rechkflag == '9'">
                                    <font color="#000000">审</font>
                                </div>
                                <div :key="row.userno + rowIndex + columnIndex" v-else></div>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="rptunitname" sortable title="报告单元" width="130" show-overflow></vxe-table-column>
                        <vxe-table-column align="center" field="sampledate" sortable title="标本日期" width="70" :formatter="['toDateString', 'yyyy-MM-dd']" show-overflow></vxe-table-column>
                        <vxe-table-column field="sampleno" align="center" sortable title="标本号" width="60" show-overflow :sort-width="20"></vxe-table-column>
                        <!-- 添加打印选择-->

                        <vxe-table-column field="pat_name" align="center" sortable title="病人姓名" width="60" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_sexname" align="center" sortable title="性别" width="35" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_agestr" align="center" sortable title="年龄" width="40" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_no" sortable title="病人号" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="rechk_dt" align="center" sortable title="审核时间" width="120" show-overflow></vxe-table-column>
                        <vxe-table-column field="rechk_user" align="center" sortable title="审核医生" width="60" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_reason" sortable title="送检目的" width="400" show-overflow></vxe-table-column>
                        <vxe-table-column field="specimen" sortable title="标本类型" width="90" show-overflow></vxe-table-column>
                        <vxe-table-column field="barcode" sortable title="条码号" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="hospcode" sortable title="送检医院" width="180" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_cardno" sortable title="就诊卡号" width="110" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_id" sortable title="病人ID" width="130" show-overflow></vxe-table-column>
                        <vxe-table-column field="inp_id" sortable title="就诊号" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_idcardno" sortable title="身份证/护照号" width="200" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_phone" sortable title="联系电话" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_address" sortable title="病人地址" width="200" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_birth" align="center" sortable title="病人生日" width="90" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_typecodename" align="center" sortable title="病人类别" width="80" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_dept" sortable title="申请科室" width="150" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_ward" sortable title="病人病区" width="120" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_bedno" align="center" sortable title="床号" width="50" show-overflow></vxe-table-column>
                        <vxe-table-column field="charge_typeno" align="center" sortable title="收费类别" width="90" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_diag_icd" sortable title="临床诊断标准码" width="160" show-overflow></vxe-table-column>
                        <vxe-table-column field="pat_diag" sortable title="临床诊断" width="250" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_doc" align="center" sortable title="申请医生" width="70" show-overflow></vxe-table-column>
                        <vxe-table-column field="req_dt" align="center" sortable title="申请时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="sampled_dt" align="center" sortable title="采样时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="recieve_dt" align="center" sortable title="接收时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="report_dt" align="center" sortable title="报告时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="report_user" align="center" sortable title="检验医生" width="70" show-overflow></vxe-table-column>
                        <vxe-table-column field="reportid" sortable title="报告ID" width="160" show-overflow></vxe-table-column>
                        <vxe-table-column field="inp_date" align="center" sortable title="入院日期" width="140" show-overflow></vxe-table-column>

                        <!-- <vxe-table-column field="input_dt" align="center" sortable title="录入时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="test_info" sortable title="上机信息" width="120" show-overflow></vxe-table-column>
                        <vxe-table-column field="test_dt" align="center" sortable title="上机时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="report_comm" sortable title="报告单备注" width="150" show-overflow></vxe-table-column>
                        <vxe-table-column field="lab_advice" sortable title="实验室意见" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="item_num" align="center" sortable title="项目数" width="50" show-overflow></vxe-table-column>
                        <vxe-table-column field="instr_advice" sortable title="仪器辅助诊断" width="150" show-overflow></vxe-table-column>
                        <vxe-table-column field="rechk2_dt" align="center" sortable title="二审时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="rechk2_user" align="center" sortable title="二审医生" width="70" show-overflow></vxe-table-column>
                        <vxe-table-column field="lastprint_dt" align="center" sortable title="最后打印时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="prereport_dt" align="center" sortable title="预计报告时间" width="140" show-overflow></vxe-table-column>
                        <vxe-table-column field="release_user" align="center" sortable title="发布人" width="70" show-overflow></vxe-table-column>
                        <vxe-table-column field="is_changed" align="center" sortable title="是否修改" width="70" show-overflow></vxe-table-column>
                        <vxe-table-column field="changed_afterreport" align="center" sortable title="打印、审核后修改" width="130" show-overflow></vxe-table-column>
                        <vxe-table-column field="unprint_flag" align="center" sortable title="禁止打印标志" width="100" show-overflow></vxe-table-column>
                        <vxe-table-column field="print_count" align="center" sortable title="打印次数" width="60" show-overflow></vxe-table-column>
                        <vxe-table-column field="unprint_reason" sortable title="禁止打印原因" width="120" show-overflow></vxe-table-column> -->
                    </vxe-table>
                </div>
            </rm-layout-left>
        </div>
    </div>
</template>

<script type="text/javascript">
import input from "../../../../element-ui/packages/input/src/input.vue";
import XE from "xe-utils"; //引入工具类
XE.mixin({
    // 自定义全局的格式化处理函数
    formatSelect(cellValue, list) {
        return list[cellValue] || cellValue;
    },
});
XE.mixin({
    // 自定义全局的格式化处理函数
    formatSelectList(cellValue, list) {
        let item = list.find((item) => item.data == cellValue);
        return item ? item.display : "";
    },
});
export default {
    components: { input },
    name: "LIS236",
    data() {
        return {
            report_data: [],
            ChangeList: [],
            report_Loading: false,
            MasterDataLoading: false,
            ChangeLoading: false,
            selectall: false,
            flagcheck: "1",
            datetime1: "",
            datetime2: "",
            hospitalcode: "",
            hospitalname: "",
            barcode: "",
            patno: "",
            userid: "",
            dealdata: [],
        };
    },
    components: {},
    watch: {},
    computed: {},
    created() {
        this.getoption();
    },
    mounted() {},
    updated() {},
    methods: {
        btnSign() {
            this.ChangeLoading = true;
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS236",
                    method: "post",
                    data: {
                        action: "query",
                        datetime1: this.datetime1,
                        datetime2: this.datetime2,
                        barcode: this.barcode,
                        patno: this.patno,
                        hospcode: this.hospitalcode,
                    },
                })
                .then((res) => {
                    this.ChangeList = res.data;
                    if (this.ChangeList.length > 0) {
                        this.$nextTick(() => {
                            this.$refs.xTable2.setCurrentRow(this.ChangeList[0]);
                            this.getdetail(this.ChangeList[0]);
                        });
                    }
                    this.ChangeLoading = false;
                })
                .catch((e) => {
                    this.ChangeLoading = false;
                    console.log("error", e);
                });
        },
        getoption() {
            //从服务器获取配置
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS236",
                    method: "post",
                    data: {
                        action: "getoptions",
                    },
                })
                .then((res) => {
                    this.datetime1 = res.stime + " 00:00:00";
                    this.datetime2 = res.etime + " 23:59:59";
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        // 清除按钮事件
        btnClear() {
            this.barcode = "";
            this.hospitalcode = "";
            this.patno = "";
            this.flagcheck = "1";
            this.getoption();
        },
        hospchange(code, name) {
            this.hospitalcode = code;
            this.hospitalname = name;
        },
        // 导出按钮事件
        btnExport() {
            let tableColumn = this.$refs.xTable2.getColumns();
            let extableColumn = [];
            tableColumn.forEach((item) => {
                extableColumn.push({ title: item.title, field: item.property });
            });
            let filtertxt = this.getExportFilter();
            this.$pub.exportTableExcel(this.$refs.xTable2.getSelectRecords(), extableColumn, "LIS236申请单信息修改处理.xlsx", filtertxt);
        },
        // 获取当前导出文件的所有查询条件
        getExportFilter() {
            let filtertxt = "生成时间:" + XE.toDateString(this.datetime1, "yyyy-MM-dd HH:mm:ss") + "至" + XE.toDateString(this.datetime2, "yyyy-MM-dd HH:mm:ss") + "; ";
            if(this.barcode) filtertxt += "条码号:" + this.barcode + "; ";
            if(this.flagcheck == "1") filtertxt += "已审核的报告自动发布; ";
            if(this.hospitalcode) filtertxt += "送检医院:" + this.hospitalname + "; ";
            if(this.patno) filtertxt += "病历号:"+ this.patno + "; ";
            return filtertxt;
        },
        detailretrieve({ row }) {
            this.ChangeLoading = true;
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS236",
                    method: "post",
                    data: {
                        action: "detail",
                        req_changedid: row.req_changedid,
                    },
                })
                .then((res) => {
                    this.ChangeList = res.data;
                    this.ChangeLoading = false;
                })
                .catch((e) => {
                    this.ChangeLoading = false;
                    console.log("error", e);
                });
            this.focusBarcode();
        },

        hasChange() {
            this.report_data = [];
            this.LogList = [];
            this.btnSign();
        },

        ChkAll(e) {
            if (this.report_data != null && this.report_data.length > 0) {
                this.report_data.forEach((item) => {
                    if (!item.operuser) {
                        item.cp_selection = e == true ? "1" : "0";
                    }
                });
            }
        },

        //"rm-cancel"; //作废
        //"rm-disable"; //禁用
        //"rm-readonly"; //只读
        //"rm-alert"; //警告
        reportRowName({ row, rowIndex }) {
            if (row.rechk_dt != "" && row.rechk_dt != " " && row.rechk_dt != null) {
                if (XE.toNumber(row.print_count) > 0) {
                    return "rm-gray"; //审核过打印的
                } else {
                    return "colrow"; //没打印的
                }
            }
        },

        reportCellName({ row, rowIndex, column, columnIndex }) {
            if (column.property == "alter_flag") {
                if (row.alter_flag == "1" || row.alter_flag == "2") {
                    return "colred";
                }
            } else if (column.property == "redo_flag") {
                if (row.redo_flag == "2" || row.redo_flag == "3") {
                    return "colgreen";
                }
            } else if (column.property == "pat_name" || column.property == "pat_no") {
                // 添加链接查询颜色
                return "col-blue";
            } else if (column.property == "unprint_reason") {
                return "col-red";
            }

            // if (column.property == "emer_flag") {
            //     if (row.emer_flag != "0") {
            //         return "rm_cell_green";
            //     }
            // }
        },

        // async sync() {
        //     if (this.ChangeList.length > 0)
        //         for (const row of this.ChangeList) {
        //             const res = await this.$tool.request({
        //                 url: "LIS/LIS2/LIS236",
        //                 method: "post",
        //                 data: {
        //                     action: "sync",
        //                     barcode: row.barcode
        //                 }
        //             });
        //             // console.log("dddd", res);
        //             if (res.msg != "") row.changecomments = await res.msg; //表格显示结果
        //         }
        // },

        async btnBatchSend() {
            //console.info("1111111111");
            let seldata = this.$refs.xTable2.getSelectRecords();
            if (seldata.length == 0) {
                this.$message("请勾选修改申请记录数据！！！");
                return;
            }
            if (seldata.length == 1) {
                //console.info("22222");
                // let nowrowlist = this.$refs.xTable2.getCurrentRow();
                // let nowrow = this.ChangeList.find(item => item.req_changedid == nowrowlist.req_changedid);
                let reports = this.report_data.filter((x) => x.cp_selection == "1");
                if (reports.length == 0) {
                    this.$alert("请选择要应用到的报告", "提示");
                }
                let nowrow = seldata[0];
                var success = 0;
                var fail = 0;
                if (reports.length > 0) {
                    for (let i = 0; i < reports.length; i++) {
                        let row = reports[i];
                        //this.inn_remindtxt = "正在签收第" + barnum + "个条码，条码号" + row.barcode + " (" + barnum + "/" + alen + ")";
                        const res = await this.$tool.request({
                            url: "LIS/LIS2/LIS236",
                            method: "post",
                            data: {
                                action: "btnBatchSend",
                                barcode: row.barcode,
                                reportid: row.reportid,
                                req_changedid: nowrow.req_changedid,
                                flagcheck: this.flagcheck,
                            },
                        });
                        // console.log("dddd", res);
                        var msg = "";
                        if (res.flag == "1") {
                            nowrow.status = res.status;
                            if (res.status == "1") nowrow.statusname = "部分处理";
                            else if (res.status == "2") nowrow.statusname = "处理完成";
                            msg = "操作成功";
                            success++;
                        } else {
                            msg = res.msg;
                            if (!msg) msg = res.errmsg;
                            fail++;
                        }
                        row.resultmsg = msg; //表格显示结果
                        if (res.flag == "1") {
                            row.operuser = res.data[0].operuser; //表格操作人
                            row.operdt = res.data[0].operdt; //表格显示操作时间
                        }
                        if (i == reports.length - 1) {
                            var finalmsg = "全部选中报告操作完成";
                            if (success > 0) finalmsg += ",成功" + success + "条";
                            if (fail > 0) finalmsg += ",失败" + fail + "条";
                            this.$alert(finalmsg, "提示");
                        }
                    }
                    this.$refs.reportTable.loadData(this.report_data);
                    this.$refs.xTable2.loadData(this.ChangeList).then(() => {
                        this.$refs.xTable2.setCurrentRow(nowrow);
                    });
                }
            } else {
                var success = 0;
                var fail = 0;
                for (let index = 0; index < seldata.length; index++) {
                    let element = seldata[index];
                    const res = await this.$tool.request({
                        url: "LIS/LIS2/LIS236",
                        method: "post",
                        data: {
                            action: "detail",
                            barcode: element.barcode,
                            req_changedid: element.req_changedid,
                        },
                    });
                    if (res.data != null && res.data.length > 0) {
                        let reports = res.data;
                        if (reports != null && reports.length > 0) {
                            for (let i = 0; i < reports.length; i++) {
                                let row = reports[i];
                                const res = await this.$tool.request({
                                    url: "LIS/LIS2/LIS236",
                                    method: "post",
                                    data: {
                                        action: "btnBatchSend",
                                        barcode: row.barcode,
                                        reportid: row.reportid,
                                        req_changedid: element.req_changedid,
                                        flagcheck: this.flagcheck,
                                    },
                                });
                                var msg = "";
                                if (res.flag == "1") {
                                    element.status = res.status;
                                    if (res.status == "1") element.statusname = "部分处理";
                                    else if (res.status == "2") element.statusname = "处理完成";
                                    msg = "操作成功";
                                    success++;
                                } else {
                                    msg = res.msg;
                                    if (!msg) msg = res.errmsg;
                                    fail++;
                                }
                                row.resultmsg = msg; //表格显示结果
                            }
                        }
                    }

                    this.$refs.reportTable.loadData(this.report_data);
                    this.$refs.xTable2.loadData(this.ChangeList).then(() => {
                        this.$refs.xTable2.setCurrentRow(element);
                    });
                    if (index == seldata.length - 1) {
                        var finalmsg = "全部选中报告操作完成";
                        if (success > 0) finalmsg += ",成功" + success + "条";
                        if (fail > 0) finalmsg += ",失败" + fail + "条";
                        this.$alert(finalmsg, "提示");
                    }
                }
            }
        },

        async btnUncheck() {
            let seldata = this.$refs.xTable2.getSelectRecords();
            let reports = this.report_data.filter((x) => x.cp_selection == "1");
            if (seldata.length == 0) {
                this.$message("请勾选数据！！！");
                return;
            }
            if (seldata.length == 1 && reports.length == 0) {
                this.$alert("请选择要解除审核的报告", "提示");
                return;
            }
            if (this.userid == "") {
                this.$rm_Login({
                    type: "请输入审核者工号和密码",
                    btn: {
                        confirmBtnText: "确定",
                        cancelBtnText: "取消",
                    },
                }).then((res) => {
                    if (res.flag == "1") {
                        this.userid = res.userid;
                        this.UnCheckRequest();
                    }
                });
            } else {
                this.UnCheckRequest();
            }
        },

        UnCheckRequest() {
            let seldata = this.$refs.xTable2.getSelectRecords();
            if (seldata.length == "1") {
                let reports = this.report_data.filter((x) => x.cp_selection == "1");
                for (let i = 0; i < reports.length; i++) {
                    let row = reports[i];
                    //this.inn_remindtxt = "正在签收第" + barnum + "个条码，条码号" + row.barcode + " (" + barnum + "/" + alen + ")";
                    this.$tool
                        .request({
                            url: "LIS/LIS2/LIS236",
                            method: "post",
                            data: {
                                action: "uncheckreport",
                                reportid: row.reportid,
                                userno: this.userid,
                            },
                        })
                        .then((res) => {
                            var msg = "";
                            if (res.flag == "1") msg = "解除审核成功";
                            else msg = "解除审核出错!请到报告界面操作";
                            row.resultmsg = msg; //表格显示结果
                            if (i == reports.length - 1) {
                                this.$alert("全部选中报告操作完成!", "提示");
                                this.$refs.reportTable.loadData(this.report_data);
                            }
                        });
                }
            } else {
                for (let index = 0; index < seldata.length; index++) {
                    const element = seldata[index];
                    this.$tool
                        .request({
                            url: "LIS/LIS2/LIS236",
                            method: "post",
                            data: {
                                action: "detail",
                                barcode: element.barcode,
                                req_changedid: element.req_changedid,
                            },
                        })
                        .then((res) => {
                            let reports = res.data;
                            if (reports != null && reports.length > 0) {
                                for (let i = 0; i < reports.length; i++) {
                                    let row = reports[i];
                                    //this.inn_remindtxt = "正在签收第" + barnum + "个条码，条码号" + row.barcode + " (" + barnum + "/" + alen + ")";
                                    this.$tool
                                        .request({
                                            url: "LIS/LIS2/LIS236",
                                            method: "post",
                                            data: {
                                                action: "uncheckreport",
                                                reportid: row.reportid,
                                                userno: this.userid,
                                            },
                                        })
                                        .then((res) => {
                                            var msg = "";
                                            if (res.flag == "1") msg = "解除审核成功";
                                            else msg = "解除审核出错!请到报告界面操作";
                                            row.resultmsg = msg; //表格显示结果
                                            if (i == reports.length - 1) {
                                                this.$alert("全部选中报告操作完成!", "提示");
                                                //this.$refs.reportTable.loadData(this.report_data);
                                                this.$refs.xTable2.setCurrentRow(element);
                                            }
                                        });
                                    // console.log("dddd", res);
                                }
                                console.log("this.report_data", this.report_data);
                            }
                        })
                        .catch((e) => {
                            this.report_Loading = false;
                            console.log("error", e);
                        });
                }
            }
        },

        change_Event({ row }) {
            this.getdetail(row);
        },
        getdetail(row) {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS236",
                    method: "post",
                    data: {
                        action: "detail",
                        barcode: row.barcode,
                        req_changedid: row.req_changedid,
                    },
                })
                .then((res) => {
                    this.report_data = res.data;
                    this.report_Loading = false;
                })
                .catch((e) => {
                    this.report_Loading = false;
                    console.log("error", e);
                });
        },
    },
};
</script>

<style scoped>
.pagetop {
    width: 100%;
    left: 0;
    right: 0;
    display: -webkit-box;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    border: solid 1px #ccc;
    position: absolute;
    z-index: 99;
    height: 80px;
    overflow-x: auto;
    overflow-x: overlay;
}

.pagecenter {
    position: absolute;
    top: 85px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}

.middle-center {
    position: absolute;
    height: 100%;
    left: 0px;
    right: 455px;
    overflow: auto;
}

.middle-right {
    position: absolute;
    height: 100%;
    width: 450px;
    right: 0px;
}
.table1style tr td {
    padding: 1px 1px 1px 5px;
}
::-webkit-scrollbar {
    width: 0px;
    height: 5px;
    border: 4px solid white;
}
::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
}
::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}
/* Buttons */
::-webkit-scrollbar-button:single-button {
    background-color: #bbbbbb;
    display: block;
    border-style: solid;
    height: 5px;
    width: 5px;
}
/* Left */
::-webkit-scrollbar-button:horizontal:decrement {
    margin-right: 2px;
    border-width: 4px 4px 4px 0;
    border-color: #f1f1f1 transparent #f1f1f1 #f1f1f1;
    background-color: #000000;
}
::-webkit-scrollbar-button:horizontal:decrement:hover {
    border-color: #d2d2d2 transparent #d2d2d2 #d2d2d2;
}
/* Right */
::-webkit-scrollbar-button:horizontal:increment {
    margin-left: 2px;
    border-width: 4px 0 4px 4px;
    border-color: #f1f1f1 #f1f1f1 #f1f1f1 transparent;
    background-color: #000000;
}
::-webkit-scrollbar-button:horizontal:increment:hover {
    border-color: #d2d2d2 #d2d2d2 #d2d2d2 transparent;
}
.table2style tr td {
    padding: 0px 2px 0px 2px;
}
/deep/.popdialogstyle tr td div .el-input__inner {
    border: 1px solid rgba(255, 254, 254, 0) !important;
    background-color: rgba(255, 254, 254, 0) !important;
}
/deep/ .el-message-box {
    width: 670px;
}
.mytableclass table tr td {
    padding: 3px;
}
.top-deal {
    right: 5px;
    position: absolute;
    top: 50px;
    display: flex;
    align-items: center;
}
/deep/.processingcls td {
    color: #1087ba;
}
/deep/.errocls td {
    color: red;
}
/deep/.erroalreadyread td {
    color: #0a5fb4;
}
.el-switch,
.el-checkbox {
    float: right;
}
.el-checkbox .el-checkbox__label {
    font-size: 14px !important;
}
#barcodediv::-webkit-input-placeholder {
    color: #0000ff;
}
/deep/ tr.vxe-body--row.row-modify {
    color: blue !important;
}
/deep/ tr.vxe-body--row.row-new {
    color: #cc6600 !important;
}
/deep/.color-red {
    color: red !important;
}
::v-deep .colrow {
    background-color: #c0ffc0;
}
</style>
